﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace myFinance.Controls
{
    public partial class AddIncome : UserControl, Entity.IIncome
    {
        public AddIncome()
        {
            InitializeComponent();

            this.txtIncomeName.Focus();
        }

        #region IIncome Members

        string myFinance.Entity.IIncome.Name
        {
            get
            {
                return this.txtIncomeName.Text;
            }
            set
            {
                this.txtIncomeName.Text = value;
            }
        }

        DateTime myFinance.Entity.IIncome.Date
        {
            get
            {
                return this.dtpIncomeDate.Value;
            }
            set
            {
                this.dtpIncomeDate.Value = value;
            }
        }

        double myFinance.Entity.IIncome.Amount
        {
            get
            {                
                return double.Parse(this.txtAmount.Text);
            }
            set
            {
                this.txtAmount.Text = value.ToString();
            }
        }

        #endregion
    }
}
